#include "widget3.h"
#include "ui_widget3.h"

Widget3::Widget3(FlightBookingSystem& system,QWidget *parent)
    :bookingSystem(system),
    QWidget(parent),
    ui(new Ui::Widget3)
{
    ui->setupUi(this);
}

Widget3::~Widget3()
{
    delete ui;
}

void Widget3::on_pushButton_determine_clicked()
{
    this->close();
    bookingSystem.cancelTicket(flightNumber,passengerName);
}


void Widget3::on_pushButton_cancel_clicked()
{
    emit this->back();
}


void Widget3::on_lineEdit1_textChanged(const QString &arg1)
{
    string s=arg1.toStdString();
    this->flightNumber=s;
}


void Widget3::on_lineEdit2_textChanged(const QString &arg1)
{
    string s=arg1.toStdString();
    this->passengerName=s;
}

